var sequelizeService = require('../utils/sequelizeService');

sequelizeService.sequelize
    .sync()
    .then(function() {
        var Model = sequelizeService.models.Category;
        var array = [{
            code: '01',
            name: '关于我'
        }, {
            code: '02',
            name: '技术分享'
        }, {
            code: '03',
            name: '杂谈'
        }];

        Model.bulkCreate(array, { individualHooks: true })
            .then(function() {
                console.log('新增 %d 笔记录', array.length);
            })
            .error(function(err) {
                console.error(err);
            })
    });
